<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>验证是否是手机号</title>
		<!-- 导入 jquery 核心类库 -->
		<script type="text/javascript" src="js/jquery-1.8.3.js"></script>
		<!-- 导入 easyui 类库 -->
		<script type="text/javascript " src="js/easyui/jquery.easyui.min.js"></script>
		<!– 导入默认主题 CSS 文件-->
		<link id="easyuiTheme" rel="stylesheet" type="text/css" href="js/easyui/themes/default/easyui.css">
		<!– 导入图标 CSS 文件-->
		<link rel="stylesheet " type="text/css " href="js/easyui/themes/icon.css">
		<!– 导入国际化信息文件-->
		<script src="js/easyui/locale/easyui-lang-zh_CN.js" type="text/javascript "></script>
		<!-- 引入ztree -->
		<script src="js/ztree/jquery.ztree.all-3.5.js" type="text/javascript" charset="UTF-8"></script>
		<link rel="stylesheet" type="text/css" href="js/ztree/zTreeStyle.css" />

		<link rel="stylesheet" type="text/css" href="css/register.css" />

		<script>
			window.onload = function() {
				var inpEle = document.getElementById('inp');
				var myreg = /^1[3578]\d{9}$/; 
				inpEle.onblur = function() {
					var inpVal = this.value;
					if(!myreg.exec(inpVal)) {
						$("#sp").html("<font color='red'>请输入正确的手机号</font>")
					} else {
						$("#sp").html("<font color='green'>校验通过</font>")

					}
				}
			}
		</script>

	</head>

	<body>
		<table>
			<tr>
				<td>手机号:</td>
				<td>
					<input type="text" id="inp" ><span id="sp"></span>
				</td>
			</tr>
		</table>
		
	</body>

</html>